package pos.domain;

public class CategoryImpl implements Category {

	private String id;
	private String name;
	private String score;
	private Discipline discipline;

	public CategoryImpl() {

	}

	public CategoryImpl(String id, String name, Discipline discipline) {
		super();
		this.id = id;
		this.name = name;
		this.discipline = discipline;
	}

	public String getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public Discipline getDiscipline() {
		return discipline;
	}

	public String getScore() {
		return score;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setDiscipline(Discipline discipline) {
		this.discipline = discipline;
	}

	public void setScore(String score) {
		this.score = score;
	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
//		result = prime * result
//				+ ((discipline == null) ? 0 : discipline.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
//		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CategoryImpl other = (CategoryImpl) obj;
		if (discipline == null) {
			if (other.discipline != null)
				return false;
		} else if (!discipline.equals(other.discipline))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	public String toString() {
		return "CategoryImpl [id=" + id + ", name=" + name + "," +
				" discipline="+ discipline + "" +
						 "]";
	}

}
